﻿using FastBuild;
using FileSynchronization.Entity;
using FileSynchronization.Model;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;

namespace FileSynchronization.Controllers
{
    /// <summary>
    /// 
    /// </summary>
    [Route("Common")]
    [ApiController]
    public class CommonController : DataAccess
    {
        /// <summary>
        /// 
        /// </summary>
        public CommonController()
        {
        }

        /// <summary>
        /// 获取发布配置
        /// </summary>
        /// <returns></returns>
        [HttpGet("PublishSetting"), AllowAnonymous]
        public async Task<List<PublishSetting>> GetPublishSetting()
        {
            try
            {
                return await Db.Queryable<PublishSetting>().ToListAsync();
            }
            catch (Exception ex)
            {
                _logger.Error(ex, "GetPublishSetting Error");
                throw;
            }
        }
    }
}
